#ifndef LEVELOP_H
#define LEVELOP_H

#include "FiniteDiff/RectDomain.h"
#include "Core/Tensor.h"

template <int Dim>
class LevelOp
{
public:
  LevelOp(const RectDomain<Dim> &aRd) : rd(aRd) { }

  template <class T>
  void LAPC_4TH(Real alpha, const Tensor<Real,Dim> &phi, const T &rhs, Tensor<Real,Dim> &LofPhi) const;
  void LAPC_4TH(const Tensor<Real,Dim> &phi, Tensor<Real,Dim> &LofPhi) const;
  void LAPC_4TH(const Tensor<Real,Dim> &phi, const Tensor<Real,Dim> &rhs, Tensor<Real,Dim> &rsd) const;
  void RELAX_4TH(const Tensor<Real,Dim> &phi, const Tensor<Real,Dim> &rhs, Tensor<Real,Dim> &JofPhi, Real w = 1.0) const;

  Real NRM(const Tensor<Real,Dim> &lhs, int nt) const;

protected:
  const RectDomain<Dim> rd;
};

#endif //LEVELOP_H
